//
//  DataOfQuestionsAndAnswers.m
//  LCOnePsychology
//
//  Created by li cheng on 16/09/05
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "DataOfQuestionsAndAnswers.h"
#import "BannerOfQuestionsAndAnswers.h"
#import "QuestionOfQuestionsAndAnswers.h"
#import "MsgOfQuestionsAndAnswers.h"
@implementation DataOfQuestionsAndAnswers

+ (NSDictionary *)objectClassInArray{
    return @{@"banner" : [BannerOfQuestionsAndAnswers class], @"question" : [QuestionOfQuestionsAndAnswers class]};
}

- (void)setValue:(id)value forKey:(NSString *)key{
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"banner"]) {
        NSMutableArray<BannerOfQuestionsAndAnswers *> *mArrayOfBannerOfQuestionsAndAnswers = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            BannerOfQuestionsAndAnswers *bannerOfQuestionsAndAnswers = [BannerOfQuestionsAndAnswers modelDic:dic];
            [mArrayOfBannerOfQuestionsAndAnswers addObject:bannerOfQuestionsAndAnswers];
        }
        _banner = mArrayOfBannerOfQuestionsAndAnswers;
    }
    if ([key isEqualToString:@"question"]) {
        NSMutableArray<QuestionOfQuestionsAndAnswers *> *mArrayOfQuestionOfQuestionsAndAnswers = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            QuestionOfQuestionsAndAnswers *questionOfQuestionsAndAnswers = [QuestionOfQuestionsAndAnswers modelDic:dic];
            [mArrayOfQuestionOfQuestionsAndAnswers addObject:questionOfQuestionsAndAnswers];
        }
        _question = mArrayOfQuestionOfQuestionsAndAnswers;
    }
    if ([key isEqualToString:@"msg"]) {
        MsgOfQuestionsAndAnswers *msgOfQuestionsAndAnswers = [MsgOfQuestionsAndAnswers modelDic:value];
        _msg = msgOfQuestionsAndAnswers;
    }
}

@end
